/**
 * @Author     :lanbery
 * @e-mail     : lanbery@gmail.com
 * @version    : V1.0
 * @createtime : 2011-11-19-上午11:13:49
 */
package com.lambor.sys.biz.impl;

import java.util.List;

import javax.inject.Inject;

import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;

import com.lambor.common.dao.BaseMapperDao;
import com.lambor.sys.biz.IUserBiz;
import com.lambor.sys.entity.User;
import com.lambor.sys.mapper.UserMapper;

/**
 * @about this class :
 * @author           ： lanbery
 * @e-mail           : lanbery@gmail.com
 * @version          : V1.0
 * @modifytime       : 2011-11-19-上午11:13:49
 * @filepath         : SSI-com.lambor.sys.biz.impl//UserBizImpl.java
 *
 */
@Service
public class UserBizImpl<T extends User> implements IUserBiz<T>{
	
	@Inject
	private BaseMapperDao<User> dao;
	@Inject
	private UserMapper<User> mapper;
	
	public void init(){
		dao.setMapperClass(UserMapper.class);
	}

	/* (non-Javadoc)
	 * @see com.lambor.sys.biz.IUserBiz#add()
	 */
	public boolean add(User user) throws DataAccessException {
		boolean bFlag = false;
		init();
		try{
			dao.add(user);
			bFlag = true;
		}catch (Exception exception) {
			// TODO: handle exception
		}
		return bFlag;
	}

	/* (non-Javadoc)
	 * @see com.lambor.sys.biz.IUserBiz#queryListByName(java.lang.String)
	 */
	public List<User> queryListByName(String name) throws DataAccessException {
		List<User> result= null;
		
		try{
			result = mapper.queryListByName(name);
		}catch (Exception exception) {
			// TODO: handle exception
		}
		
		return result;
	}



}
